<template>
    <div class="balance">
        <!-- <h2>余额页面</h2> -->
        <div class="top">
            <div class="top-content">
                <div class="left">
                    总资产(元)
                    <h2>{{ money }}</h2>
                </div>
                <router-link tag="div" to="/addmoney" class="rightmenoy">充值</router-link>
            </div>

            <div class="bottom-content">
                <div class="left">
                    累计充值(元)
                    <h2>0</h2>
                </div>
                <div class="right">
                    累计消费(元)
                    <h2>100087.73</h2>
                </div>
            </div>
        </div>

        <!-- 账单记录部分 -->
        <ul class="uls">
            <li><img src="../../assets/image/money1.png" alt="" /> <span>账单记录</span></li>
            <li><img src="../../assets/image/money2.png" alt="" /> <span>消费记录</span></li>
            <li><img src="../../assets/image/money3.png" alt="" /> <span>充值记录</span></li>
            <li><img src="../../assets/image/money4.png" alt="" /> <span>积分中心</span></li>
        </ul>
        <!-- 积分 / 优惠券 -->
        <div class="reel">
            <img src="../../assets/image/moneyleft.png" style="margin-left: 10px" alt="" />
            <img src="../../assets/image/monetrught.png" style="margin-right: 10px" alt="" />
        </div>
        <!-- 最新活动 -->
        <ol class="ols">
            <li>
                <img src="../../assets/image/new1.png" alt="" />
                <div>
                    <h3>最新拼团活动</h3>
                    <h2>最新得优惠商品上架拼团</h2>
                </div>
                <i>已结束</i>
            </li>
            <li>
                <img src="../../assets/image/new2.png" alt="" />
                <div>
                    <h3>当前限时秒杀</h3>
                    <h2>最新商品秒杀进行中</h2>
                </div>
                <i>已结束</i>
            </li>
            <li>
                <img src="../../assets/image/new3.png" alt="" />
                <div>
                    <h3>砍价活动</h3>
                    <h2>呼唤朋友来砍价</h2>
                </div>
                <i>已结束</i>
            </li>
        </ol>

        <!-- 为你推荐部分 -->
        <recom-mended></recom-mended>
    </div>
</template>

<script>
import RecomMended from "../RecomMended.vue";
import { mapState } from "vuex";
export default {
    components: { RecomMended },
    computed: {
        ...mapState(["money"]),
    },
};
</script>
<style lang="scss" scoped>
.top {
    width: 345px;
    height: 165px;
    margin: 10px auto;
    background-image: linear-gradient(90deg, #f33b2b 0, #f36053);
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    padding: 20px;
    box-sizing: border-box;
    font-size: 14px;
    color: rgb(201, 193, 193);
    .top-content {
        width: 100%;
        display: flex;
        justify-content: space-between;
    }
    .bottom-content {
        width: 100%;
        display: flex;
        justify-content: space-between;
    }
    h2 {
        font-size: 30px;
        margin-top: 5px;
        color: #fff;
    }
    .rightmenoy {
        width: 75px;
        height: 24px;
        line-height: 24px;
        text-align: center;
        background: #fff;
        color: red;
        border-radius: 20px;
    }
}

.uls {
    display: flex;
    font-size: 13px;
    justify-content: space-around;
    align-items: center;
    margin-top: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(119, 114, 114, 0.1);
    li {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        img {
            width: 22px;
            height: 22px;
        }
        span {
            margin-top: 10px;
            color: gray;
        }
    }
}

// 俩张图片
.reel {
    display: flex;
    width: 100vw;
    justify-content: space-around;
    // margin: 10px;
    box-sizing: border-box;
    // padding: 0 10px;
    img {
        width: 166px;
        height: 59px;
        margin-top: 10px;
    }
}

// 最新活动
.ols {
    margin-top: 10px;
    margin-left: 10px;
    li {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 20px;
        img {
            width: 41px;
            height: 41px;
        }
        div {
            flex: 1;
            margin-left: 10px;
            h3 {
                font-size: 16px;
            }
            h2 {
                font-size: 12px;
                color: gray;
                margin-top: 5px;
            }
        }
        i {
            width: 50px;
            font-size: 12px;
            background: rgba(171, 161, 161, 0.2);
            border-radius: 20px;
            text-align: center;
            padding: 5px 10px;
            color: gray;
            margin-right: 15px;
        }
    }
}
</style>
